package com.twu.biblioteca;

public class Movie {

    private final String name;
    private final int year;
    private final String director;
    private double prerating;

    public Movie(String name, int year, String director, double prerating) {
        this.name = name;
        this.year = year;
        this.director = director;
        this.prerating = prerating;
    }

    @Override
    public String toString() {
        String preratingStr = String.valueOf(prerating);
        if(prerating == 0){
            preratingStr = "N/A";
        }
        return "Name: " + name + " | year: " + year +" | director: " + director + " | pre-rating: " + preratingStr;
    }
}
